<template>
  <div class="bottom-bar">
    <div class="bar-item bar-left">
      <div>
        <span class="icon service"></span>
        <p class="text">客服</p>
      </div>
      <div>
        <span class="icon shop"></span>
        <p class="text">店铺</p>
      </div>
      <div>
        <span class="icon collect"></span>
        <p class="text">收藏</p>
      </div>
    </div>
    <div class="bar-item bar-right">
      <div class="cart" @click="addToClick">加入购物车</div>
      <div class="buy">购买</div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "DetailbottomBar",
    methods: {
      addToClick(){
        this.$emit("addClick");
      }
    }
  }
</script>

<style scoped>
  .bottom-bar{
    height: 49px;
    background-color: #ffffff;
    z-index: 1000;
    position: fixed;
    bottom: 0px;
    left: 0;
    right: 0;
    text-align: center;
    display: flex;
  }
  .bar-item{
    display: flex;
    flex: 1;
  }
  .bar-item>div{
    flex: 1;
  }
  .bar-left .text {
    font-size: 13px;
  }
  .bar-left .icon{
    background: url("~assets/images/Detail/detail_bottom.png") 0 0/100%;
    display: block;
    height: 20px;
    width: 20px;
    margin: 10px auto 3px;
  }
  .bottom-bar .bar-left .service{
    background-position: 0 -48px;
  }
  .bottom-bar .bar-left .shop{
    background-position: 0 -91px;
  }
  .bottom-bar .bar-left .collect{
    background-position: 0 -135px;
  }
  .bar-right{
    font-size: 15px;
    color: #ffffff;
  }
  .bar-right .cart{
    background-color: #ffe817;
    line-height: 49px;
  }
  .bar-right .buy{
    background-color: var(--color-tint);
    line-height: 49px;
  }
</style>
